<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Banji_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-banji_id" data-rule="required" data-source="banji/index" class="form-control selectpage" name="row[banji_id]" type="text" value="{$row.banji_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('联系人')}:</label>
        <div class="col-xs-12  col-sm-8">
            <table class="table fieldlist" data-template="eventtpl" data-name="row[parent_student]" id="second-table">
                <tr>
                    <td class="hidden">{:__('ID')}</td>
                    <td>{:__('家长ID')}</td>
                    <td>{:__('关系')}</td>
                    <td>{:__('等级')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[parent_student]" class="form-control hidden"  cols="30" rows="5">{$row['parent_student']}</textarea>
            <script id="eventtpl" type="text/html">
                <tr class="form-inline">
                    <td class="hidden"><input type="text" name="<%=name%>[<%=index%>][id]" class="form-control selectpage" data-field="name" value="<%=row.id%>" placeholder="ID"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][parent_id]" class="form-control selectpage" data-source="parents/index/selectpage" data-field="name" value="<%=row.parent_id%>" placeholder="家长ID"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][relation]" class="form-control selectpage" data-source="parents/selectpage1" data-field="name" value="<%=row.relation%>" placeholder="关系"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][contact]" class="form-control selectpage" data-source="parents/selectpage2" data-field="name" value="<%=row.contact%>" placeholder="等级"/></td>
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否观看')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input  id="c-switch" name="row[is_see]" type="hidden" value="{$row.is_see}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success {eq name="$row.is_see" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
            </a>
        </div>
    </div>
    <!--    <div class="form-group" data-favisible="is_see=1">-->
    <!--        <label class="control-label col-xs-12 col-sm-2">{:__('监控设备')}:</label>-->
    <!--        <div class="col-xs-12 col-sm-8">-->
    <!--            <input id="c-monitor_info_ids" data-rule="required" data-source="manystore/monitor_info/index" class="form-control selectpage" data-multiple="true" name="row[monitor_info_ids]" type="text" value="{$row.monitor_info_ids|htmlentities}">-->
    <!--        </div>-->
    <!--    </div>-->
    <div class="form-group" data-favisible="is_see=1">
        <label class="control-label col-xs-12 col-sm-2">{:__('观看到期时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[endtime]" type="text" value="{:$row.endtime?datetime($row.endtime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-gender" data-rule="required" class="form-control selectpicker" name="row[gender]">
                {foreach name="genderList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.gender"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
